home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Paint / PerfectPaint / rexx / bridge / Manual.rx next >
Encoding:
Text File  |  2000-05-27  |  5.7 KB  |  448 lines

  1. /*     Manual */
  2.  
  3.     options results
  4.     parse ARG Port Ptr M0 M1 M2 M3 M4 M5 M6 b
  5.     
  6.     ADDRESS value Port
  7.  
  8.     pp_GetWidth
  9.     W=result;W2=W/2-1
  10.  
  11.     if W=0 then EXIT
  12.  
  13.     pp_GetHeight
  14.     H=result;H2=H/2-1
  15.  
  16. IF Ptr=1|Ptr=2|Ptr=22 then DO
  17.     IF M0=1|M0=2|M0=22 THEN DO
  18.         X=M1;Y=M2;R=M3
  19.     END
  20.     ELSE
  21.     DO
  22.         X=W2
  23.         Y=H2
  24.         IF W>H THEN DO
  25.             R=H2
  26.         END
  27.         ELSE
  28.         DO
  29.             R=W2
  30.         END
  31.     END
  32.  
  33.     pp_DialogInit 150 100 "*Circle*" 3
  34.         pp_Integer 0 60 5 50 16 "X" 1 X
  35.         pp_Integer 1 60 25 50 16 "Y" 1 Y
  36.         pp_Integer 2 60 50 50 16 "Radius" 1 R
  37.     pp_Dialog
  38.     rc=result
  39.     if rc=0 then
  40.         do
  41.             EXIT
  42.         end    
  43.  
  44.     pp_UpdateUndo    
  45.         
  46.     pp_GetDialog 0
  47.     X=result
  48.  
  49.     pp_GetDialog 1
  50.     Y=result
  51.  
  52.     pp_GetDialog 2
  53.     R=result
  54.  
  55.     if Ptr=1 then DO
  56.         pp_Circle X Y R
  57.     END
  58.     ELSE
  59.     DO
  60.         pp_CircleF X Y R
  61.     END
  62. END
  63.  
  64. IF Ptr=14 then DO
  65.     pp_AvoidRefresh
  66.     IF M0=14 THEN DO
  67.         X=M1;Y=M2
  68.     END
  69.     ELSE
  70.     DO
  71.         X=W2
  72.         Y=H2
  73.     END
  74.  
  75.     pp_DialogInit 150 75 "*Text*" 2
  76.         pp_Integer 0 60 5 50 16 "X" 1 X
  77.         pp_Integer 1 60 25 50 16 "Y" 1 Y
  78.     pp_Dialog
  79.     rc=result
  80.     if rc=0 then
  81.         do
  82.             pp_PermitRefresh
  83.             EXIT
  84.         end    
  85.  
  86.     pp_UpdateUndo    
  87.  
  88.     pp_GetDialog 0
  89.     X=result
  90.  
  91.     pp_GetDialog 1
  92.     Y=result
  93.  
  94.     pp_TextDraw X Y
  95.     pp_PermitRefresh
  96.     
  97. END
  98.  
  99. IF Ptr=12|Ptr=13|Ptr=25 then DO
  100.     IF M0=12|M0=13|M0=25 THEN DO
  101.         X=M1;Y=M2;R=M3;R2=M4
  102.     END
  103.     ELSE
  104.     DO
  105.         X=W2
  106.         Y=H2
  107.         R=W2
  108.         R2=H2
  109.     END
  110.  
  111.     pp_DialogInit 150 125 "*Ellipse*" 4
  112.         pp_Integer 0 60 5 50 16 "X" 1 X
  113.         pp_Integer 1 60 25 50 16 "Y" 1 Y
  114.         pp_Integer 2 60 50 50 16 "RadiusX" 1 R
  115.         pp_Integer 3 60 70 50 16 "RadiusY" 1 R2        
  116.     pp_Dialog
  117.     rc=result
  118.     if rc=0 then
  119.         do
  120.             EXIT
  121.         end        
  122.         
  123.     pp_UpdateUndo    
  124.  
  125.     pp_GetDialog 0
  126.     X=result
  127.  
  128.     pp_GetDialog 1
  129.     Y=result
  130.  
  131.     pp_GetDialog 2
  132.     R=result
  133.  
  134.     pp_GetDialog 3
  135.     R2=result
  136.  
  137.     if Ptr=12 then DO
  138.         pp_Ellipse X Y R R2
  139.     END
  140.     ELSE
  141.     DO
  142.         pp_EllipseF X Y R R2
  143.     END
  144. END
  145.  
  146. IF Ptr=3|Ptr=4|Ptr=21 then DO
  147.     IF M0=3|M0=4|M0=21 THEN DO
  148.         X=M1;Y=M2;XX=M3;YY=M4
  149.     END
  150.     ELSE
  151.     DO
  152.         X=0
  153.         Y=0
  154.         XX=W-1
  155.         YY=H-1
  156.     END
  157.  
  158.     pp_DialogInit 150 125 "*Box*" 4
  159.         pp_Integer 0 60 5 50 16 "Start*X" 1 X
  160.         pp_Integer 1 60 25 50 16 "Start*Y" 1 Y
  161.         pp_Integer 2 60 50 50 16 "End*X" 1 XX
  162.         pp_Integer 3 60 70 50 16 "End*Y" 1 YY        
  163.     pp_Dialog
  164.     rc=result
  165.     if rc=0 then
  166.         do
  167.             EXIT
  168.         end        
  169.         
  170.     pp_UpdateUndo    
  171.  
  172.     pp_GetDialog 0
  173.     X=result
  174.  
  175.     pp_GetDialog 1
  176.     Y=result
  177.  
  178.     pp_GetDialog 2
  179.     XX=result
  180.  
  181.     pp_GetDialog 3
  182.     YY=result
  183.  
  184.     if Ptr=3 then DO
  185.         pp_Box X Y XX YY
  186.     END
  187.     ELSE
  188.     DO
  189.         pp_BoxF X Y XX YY
  190.     END
  191. END
  192.  
  193. IF Ptr=6|Ptr=7|Ptr=24 then DO
  194.     IF M0=6|M0=7|M0=24 THEN DO
  195.         X=M1;Y=M2;XX=M3;YY=M4;XXX=M5;YYY=M6
  196.     END
  197.     ELSE
  198.     DO
  199.         X=0
  200.         Y=0
  201.         XX=W-1
  202.         YY=0
  203.         XXX=W2
  204.         YYY=H-1
  205.     END
  206.  
  207.     pp_DialogInit 150 175 "*Spline*" 6
  208.         pp_Integer 0 60 5 50 16 "Start*X" 1 X
  209.         pp_Integer 1 60 25 50 16 "Start*Y" 1 Y
  210.         pp_Integer 2 60 50 50 16 "End*X" 1 XX
  211.         pp_Integer 3 60 70 50 16 "End*Y" 1 YY        
  212.         pp_Integer 4 60 95 50 16 "MX" 1 XXX
  213.         pp_Integer 5 60 115 50 16 "MY" 1 YYY    
  214.     pp_Dialog
  215.     rc=result
  216.     if rc=0 then
  217.         do
  218.             EXIT
  219.         end        
  220.         
  221.     pp_UpdateUndo    
  222.  
  223.     pp_GetDialog 0
  224.     X=result
  225.  
  226.     pp_GetDialog 1
  227.     Y=result
  228.  
  229.     pp_GetDialog 2
  230.     XX=result
  231.  
  232.     pp_GetDialog 3
  233.     YY=result
  234.  
  235.     pp_GetDialog 4
  236.     XXX=result
  237.  
  238.     pp_GetDialog 5
  239.     YYY=result
  240.  
  241.     if Ptr=6 then DO
  242.         pp_Spline X Y XX YY XXX YYY
  243.     END
  244.     ELSE
  245.     DO
  246.         pp_SplineF X Y XX YY XXX YYY
  247.     END
  248. END
  249.  
  250. IF Ptr=5|Ptr=20 then DO
  251.     IF M0=5|M0=20 THEN DO
  252.         X=M1;Y=M2;XX=M3;YY=M4
  253.     END
  254.     ELSE
  255.     DO
  256.         X=0
  257.         Y=0
  258.         XX=W-1
  259.         YY=H-1
  260.     END
  261.  
  262.     pp_DialogInit 150 125 "*Line*" 4
  263.         pp_Integer 0 60 5 50 16 "Start*X" 1 X
  264.         pp_Integer 1 60 25 50 16 "Start*Y" 1 Y
  265.         pp_Integer 2 60 50 50 16 "End*X" 1 XX
  266.         pp_Integer 3 60 70 50 16 "End*Y" 1 YY        
  267.     pp_Dialog
  268.     rc=result
  269.     if rc=0 then
  270.         do
  271.             EXIT
  272.         end        
  273.         
  274.     pp_UpdateUndo    
  275.  
  276.     pp_GetDialog 0
  277.     X=result
  278.  
  279.     pp_GetDialog 1
  280.     Y=result
  281.  
  282.     pp_GetDialog 2
  283.     XX=result
  284.  
  285.     pp_GetDialog 3
  286.     YY=result
  287.  
  288.     pp_Line X Y XX YY
  289. END
  290.  
  291. IF Ptr=15|Ptr=16 then DO
  292.     pp_DialogInit 150 75 "*Polygon*" 2
  293.         pp_Integer 0 60 5 50 16 "Shift*X" 1 0
  294.         pp_Integer 1 60 25 50 16 "Shift*Y" 1 0
  295.     pp_Dialog
  296.     rc=result
  297.     if rc=0 then
  298.         do
  299.             EXIT
  300.         end    
  301.  
  302.     pp_UpdateUndo    
  303.  
  304.     pp_GetDialog 0
  305.     xx=result
  306.  
  307.     pp_GetDialog 1
  308.     yy=result
  309.  
  310.     file="Ram:T/ppdata"
  311.     IF OPEN("g",file, "read") then
  312.     DO
  313.         tind = READLN("g")
  314.         pp_StartPoly
  315.         DO i=1 to tind
  316.             x=READLN("g")+xx
  317.             y=READLN("g")+yy
  318.             pp_AddPoly x y
  319.         END
  320.  
  321.         IF Ptr=15 then DO
  322.             pp_EndPoly
  323.         END
  324.         ELSE
  325.         DO
  326.             pp_EndPolyF
  327.         END
  328.         call close(file)
  329.     END
  330. END    
  331.  
  332. IF Ptr=17|Ptr=18 then DO
  333.     pp_DialogInit 150 75 "*Bezier*" 2
  334.         pp_Integer 0 60 5 50 16 "Shift*X" 1 0
  335.         pp_Integer 1 60 25 50 16 "Shift*Y" 1 0
  336.     pp_Dialog
  337.     rc=result
  338.     if rc=0 then
  339.         do
  340.             EXIT
  341.         end    
  342.  
  343.     pp_UpdateUndo    
  344.  
  345.     pp_GetDialog 0
  346.     xx=result
  347.  
  348.     pp_GetDialog 1
  349.     yy=result
  350.  
  351.     file="Ram:T/ppdata"
  352.     IF OPEN("g",file, "read") then
  353.     DO
  354.         tind = READLN("g")
  355.         pp_StartPoly
  356.         DO i=1 to tind
  357.             x=READLN("g")+xx
  358.             y=READLN("g")+yy
  359.             pp_AddPoly x y
  360.         END
  361.         IF Ptr=17 then DO
  362.             pp_EndPolyS
  363.         END
  364.         ELSE
  365.         DO
  366.             pp_EndPolySF
  367.         END
  368.         call close(file)
  369.     END
  370. END
  371.  
  372. IF Ptr=9 then DO
  373.     pp_DialogInit 150 75 "*Draw*Point*" 2
  374.         pp_Integer 0 60 5 50 16 "Shift*X" 1 0
  375.         pp_Integer 1 60 25 50 16 "Shift*Y" 1 0
  376.     pp_Dialog
  377.     rc=result
  378.     if rc=0 then
  379.         do
  380.             EXIT
  381.         end    
  382.  
  383.     pp_UpdateUndo    
  384.  
  385.     pp_GetDialog 0
  386.     xx=result
  387.  
  388.     pp_GetDialog 1
  389.     yy=result
  390.  
  391.     file="Ram:T/ppdata"
  392.     IF OPEN("g",file, "read") then
  393.     DO
  394.         tind = READLN("g")
  395.         pp_StartPoly
  396.         DO i=1 to tind
  397.             x=READLN("g")+xx
  398.             y=READLN("g")+yy
  399.             pp_AddPoly x y
  400.         END
  401.         pp_EndPoint
  402.         call close(file)
  403.     END
  404. END
  405.  
  406. IF Ptr=10|Ptr=11|Ptr=23 then DO
  407.     pp_DialogInit 150 75 "*Free*Draw*" 2
  408.         pp_Integer 0 60 5 50 16 "Shift*X" 1 0
  409.         pp_Integer 1 60 25 50 16 "Shift*Y" 1 0
  410.     pp_Dialog
  411.     rc=result
  412.     if rc=0 then
  413.         do
  414.             EXIT
  415.         end    
  416.  
  417.     pp_UpdateUndo    
  418.  
  419.     pp_GetDialog 0
  420.     xx=result
  421.  
  422.     pp_GetDialog 1
  423.     yy=result
  424.  
  425.     file="Ram:T/ppdata"
  426.     IF OPEN("g",file, "read") then
  427.     DO
  428.         tind = READLN("g")
  429.         pp_StartPoly
  430.         DO i=1 to tind
  431.             x=READLN("g")+xx
  432.             y=READLN("g")+yy
  433.             pp_AddPoly x y
  434.         END
  435.         IF Ptr=10 then DO
  436.             pp_EndPointL
  437.         END
  438.         ELSE
  439.         DO
  440.             pp_EndPointLF
  441.         END
  442.         call close(file)
  443.     END
  444. END
  445.  
  446.     
  447.  
  448.